package com.firefly.service.command.cms;

import com.firefly.dao.dao.cms.po.ConfigPo;
import com.firefly.dao.assembler.cms.ConfigAssembler;
import com.firefly.dao.dto.cms.ConfigDto;
import com.firefly.service.repository.cms.ConfigRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description: CMS系统配置
 * @author: lzg(萤火科技 ： 854378082 @ qq.com)
 * @date: 2022/12/12
 **/
@Service
public class ConfigCommand {
    private final ConfigAssembler configAssembler;
    private final ConfigRepository configRepository;
    @Autowired
    public ConfigCommand(ConfigAssembler configAssembler,ConfigRepository configRepository){
        this.configAssembler = configAssembler;
        this.configRepository = configRepository;
    }

    public Boolean updateById(ConfigDto request){
        request.setId(1);
        ConfigPo entity = configAssembler.getPo(request);
        return configRepository.update(entity);
    }
}
